<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

</body>
</html>
<script type="text/javascript">
    'use strict';
    let arr = [1,2,3,4,5,6];
    let a = arr[0];
    let b = arr[arr.length - 1];
    // es6提供的简便写法。x是arr的第1项，y是arr的第5项
    let [x,,,,y] = arr;
    console.log(x, y);
</script>